﻿<?php
    //新闻分类添加
if(!empty($_POST)){
    ob_clean();
    // print_r($_POST);die;
   //把要上次的数据存储在 $where的数组里面
   $where['username']=$_POST['username'];//用户名
   $where['password']=$_POST['password'];//密码
   $where['realname']=$_POST['realname'];//真实名字
   $where['name_of_user']=$_POST['name_of_user'];//用户名称
   // $where['sex']=$_POST['sex'];//性别
   $where['age']=$_POST['age'];//年龄
   $where['Mail']=$_POST['Mail'];//邮箱
   $where['tel']=$_POST['tel'];//联系号码
   // $where['role']=$_POST['role'];//角色
   $rows=db_add('admin',$where);
          if ($rows>0) {
        echo '<script>alert("添加成功");location.href="index.php?c=admin&a=list&admin=1"</script>';die;
    }else{
            echo '<script>alert("添加失败");history.go(-1);</script>';die;
     }
}
      //视图加载页面
      include (VIEW_LAYER.'/admin/layout.html');
?>